<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('项目管理列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label>项目编码：</label>
                            <input type="text" name="itemCode"/>
                        </li>
                        <li>
                            <label>项目名称：</label>
                            <input type="text" name="itemName"/>
                        </li>
                        <li>
                            <label>项目状态：</label>
                            <select name="status" th:with="type=${@dict.getType('sys_job_status')}">
                                <option value="">所有</option>
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                            </select>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('system:item:edit')}]];
    var removeFlag = [[${@permission.hasPermi('system:item:remove')}]];
    var statusDatas = [[${@dict.getType('sys_job_status')}]];
    var prefix = ctx + "system/item";
    var prefix1 = ctx + "system/download";

    $(function () {
        var options = {
            url: prefix + "/list",
            removeUrl: prefix1 + "/remove",
            modalName: "项目管理",
            columns: [{
                checkbox: true
            },
                {
                    field: 'itemId',
                    title: '项目ID(主键并且自增)',
                    visible: false
                },
                {
                    field: 'displayOrder',
                    title: '显示顺序'
                },
                {
                    field: 'itemCode',
                    title: '项目编码'
                },
                {
                    field: 'itemName',
                    title: '项目名称'
                },{
                    field: 'supplierName',
                    title: '供应商'
                },{
                    field: 'groupName',
                    title: '专家组'
                },
                {
                    field: 'procurementMethod',
                    title: '采购方式'
                },
                {
                    field: 'itemLeader',
                    title: '项目负责人'
                },

                {
                    field: 'status',
                    title: '项目状态',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(statusDatas, value);
                    }
                },
                {
                    field: 'createdBy',
                    title: '创建者'
                },
                {
                    field: 'createdTime',
                    title: '创建时间'
                },
                {
                    field: 'updatedBy',
                    title: '更新者'
                },
                {
                    field: 'updatedTime',
                    title: '更新时间'
                },
                {
                    field: 'itemDescription',
                    title: '项目描述'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.download(\'' + row.itemId + '\')"><i class="fa fa-download"></i>评分下载</a>');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });
</script>
</body>
</html>